package com.example.myapplication

import ApiService
import CheckVersionBean
import com.example.lib_base.base.http.ApiResponse
import com.example.lib_base.base.vm.BaseViewModel

//import com.chenyugroup.wgy_parents.bean.CheckVersionBean
//import com.chenyugroup.wgy_parents.bean.MainBean


class TestVm:BaseViewModel(){

     fun getCheckVersion() {
        launchOnIO {
            accessServer {
                ApiClient.getInstance().getService(ApiService::class.java).checkVersion(
                    mutableMapOf("" to "")
                )
            }
        }
    }
//
    override fun <T : ApiResponse<*>> serverResponseObj(bean: T, code: Int, message: String) {
        println("--------------------- json = ${bean.retcode}")

//        when(bean.data){
//            is CheckVersionBean -> {
//              println("--------------------- =-")
//            }
//            is MainBean -> {
//
//            }
//        }
    when(bean.data){
        is CheckVersionBean -> {
            println("--------------------- json = ${bean.data.toString()}")
        }

    }
    }

}